package Stream;

import java.util.ArrayList;
import java.util.List;

public class Stream1 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("我爱罗");
        list.add("林泽霖");
        list.add("林颖超");
        list.add("刘贝");
        list.stream()
                .filter(name->name.startsWith("林"))
                .filter(name->name.length()==3)
                .forEach(name-> System.out.println(name));
        //流的方法,分别筛选林开头和字数为3的名字
    }
}
